	OAM_H=$40
	OAM_V=$80
	OAM_HV=$C0
	OAM_VH=$C0
	OAM_PRIO=$20  ;setting this puts sprites behind the bg


	PTR=SRC
	SCRX=TEMP0
	SCRY=TEMP1


_metaspr:  ; ( sprofs x y D:data -- sprofs+4  )
	sta <PTR+1
	pla
	sta <PTR

	pla
	sta <SCRY
	pla
	sta <SCRX

	pla
	tax

	tya
	pha

	ldy #0
@1:
	lda (PTR),y		;y offset
	iny
	cmp #$80
	beq @2
	clc
	adc <SCRY
	sta OAM_BUF+0,x
	lda (PTR),y		;tile
	iny
	sta OAM_BUF+1,x
	lda (PTR),y		;attribute
	iny
	eor OAM_ATTR_EOR
	sta OAM_BUF+2,x
	lda (PTR),y		;x offset
	iny
	clc
	adc <SCRX
	sta OAM_BUF+3,x
	inx
	inx
	inx
	inx
	jmp @1

@2:
	pla
	tay

	lda #0
	sta OAM_ATTR_EOR
	txa
 	vmnext




; ================== ~~ PLAYER ~~ ==================

ms_player_idle_right:
	.db 0,	$4,	0,			0
	.db 0,	$6,	0,			8
	.db 16,	$24,	0,			0
	.db 16,	$24,	OAM_H,	8
	.db $80

ms_player_idle_left:
	.db 0,	$4,	OAM_H,	8
	.db 0,	$6,	OAM_H,	0
	.db 16,	$24,	0,			0
	.db 16,	$24,	OAM_H,	8
	.db $80

ms_player_idle_fwd:
	.db 0,	$c4,	0,			0
	.db 0,	$c6,	0,			8
	.db 16,	$24,	0,			0
	.db 16,	$24,	OAM_H,	8
	.db $80

ms_player_idle_back:
	.db 0,	$c0,	0,			0
	.db 0,	$c2,	0,			8
	.db 16,	$24,	0,			0
	.db 16,	$24,	OAM_H,	8
	.db $80

ms_player_jog_right_0:
	.db 0,	$8,	0,			0
	.db 0,	$A,	0,			8
	.db 16,	$28,	0,			0
	.db 16,	$2A,	0,			8
	.db $80

ms_player_jog_right_1:
	.db 0,	$E,	0,			0
	.db 0,	$10,	0,			8
	.db 16,	$2C,	0,			256-8;-8
	.db 16,	$2E,	0,			0
	.db 16,	$30,	0,			8
	.db $80

ms_player_jog_left_0:
	.db 0,	$8,	OAM_H,	8
	.db 0,	$A,	OAM_H,	0
	.db 16,	$28,	OAM_H,	8
	.db 16,	$2A,	OAM_H,	0
	.db $80

ms_player_jog_left_1:
	.db 0,	$E,	OAM_H,	8
	.db 0,	$10,	OAM_H,	0
	.db 16,	$2C,	OAM_H,	16
	.db 16,	$2E,	OAM_H,	8
	.db 16,	$30,	OAM_H,	0
	.db $80

ms_player_jog_fwd_0:
	.db 0,	$16,	OAM_H,	9
	.db 0,	$18,	OAM_H,	1
	.db 16,	$36,	OAM_H,	9
	.db 16,	$38,	OAM_H,	1
	.db $80

ms_player_jog_fwd_1:
	.db 0,	$16,	0,	0
	.db 0,	$18,	0,	8
	.db 16,	$36,	0,	0
	.db 16,	$38,	0,	8
	.db $80

ms_player_jog_back_0:
	.db 0,	$c0,	OAM_H,	8
	.db 0,	$c2,	OAM_H,	0
	.db 16,	$e0,	OAM_H,	8
	.db 16,	$e2,	OAM_H,	0
	.db $80

ms_player_jog_back_1:
	.db 0,	$c0,	0,	1
	.db 0,	$c2,	0,	9
	.db 16,	$e0,	0,	1
	.db 16,	$e2,	0,	9
	.db $80

ms_player_pickup_fwd:
	.db 0,	$20,	0,	0
	.db 0,	$22,	0,	8
	.db $80

ms_cloud_0:
	.db 0,	$fe,	2|OAM_HV, 0
	.db 16,	$de,	2|OAM_HV, 0
	.db 16,	$dc,	2|OAM_HV, 8

	.db 0,	$dc,	2, 8
	.db 0,	$de,	2, 16
	.db 16,	$fe,	2, 16
	.db $80

	.db 0,	$1A,	2, 0
	.db 0,	$1C,	2, 8
	.db 0,	$1C,	2, 16
	.db 16,	$3A,	2, 0
	.db 16,	$3C,	2, 8
	.db 16,	$3C,	2, 16
	.db $80


